﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Windows.Controls;
using AzureDiagMon.Common.Mvvm;
using AzureDiagMon.ViewModels;
using Ninject.Modules;

namespace AzureDiagMon.Views
{
    public class Module : NinjectModule
    {
        #region Overrides of NinjectModule

        public override void Load()
        {
            var a = Assembly.GetExecutingAssembly();
            var viewTypes = a.GetTypes().Where(f => f.IsSubclassOf(typeof(UserControl)));

            foreach (var viewType in viewTypes)
            {
                Bind<object>().To(viewType).Named(String.Format("View:{0}", viewType.Name));//.WithPropertyValue("View", true);
            }
        }

        #endregion
    }
}
